<?php
namespace App\Services\Admin;

use App\Repositories\Admin\AdminRepository;

class AdminService
{
    private $service;

    public function __construct()
    {
        $this->service = new AdminRepository();
    }

    public function getIndex()
    {
        return $this->service->getIndexList();
    }

    public function add($data)
    {
        return $this->service->setAdd($data);
    }

    public function modify($data,$id)
    {
        return $this->service->setModify($data,$id);
    }

    public function getOne($id)
    {
        return $this->service->getShowOne($id);
    }

    /**
     * 密码更新
     */
    public function setPwd($id,$pwd)
    {
        return $this->service->setPassword($id,$pwd);
    }

    /**
     * 通过name获取
     */
    public function getOneAdmin($name)
    {
        return $this->service->getOneByName($name);
    }
}